 <projecta charset="utf-8">

<div class="box box-primary" id="app_project_edit">
 
            <!-- form start -->
            <form role="form" id=project_edit_form>
              <div class="box-body">
              
                <div class="form-group">
                  <label for="title">项目名称</label>
                  <input type="text" name="name" v-model="project.name" class="form-control" id="name" placeholder="请输入项目名称"  required aria-required="true" >
                </div>
                 
   				 <div class="form-group">
                  <label for="title">项目简介</label>
                  <textarea class="form-control"  name="detail" v-model="project.detail"  rows="3" id="detail"></textarea>
                </div>
                
                 <div class="form-group">
                  <label for="title">项目状态</label>
                 	<select class="form-control" id="status"  v-model="project.status">
                 		<option value="1">进行中</option>
                 		<option value="3">暂停中</option>
                 		<option value="2">已结束</option>
                 		<option value="-1">已删除</option>
                 	</select>
                </div>
               </div>
              <!-- /.box-body -->
              <div class="box-footer">
                 <button type="button" class="btn btn-default" v-on:click="cancel">取消</button>
                 <button type="button" class="btn btn-info pull-right"  v-on:click="doUpdate">提交</button>
              </div>
            </form>
</div>
<script type="text/javascript">
//1进行中，2结束，3暂停中，-1删除 #
var vm = new Vue({
        el: '#app_project_edit',
        data:  {
    		project:{
    			id: null,
    			name: null,
    			detail: null,
    			status: null
    		},
    	    bus:new Vue()
     }, 
     mounted: function(){
    	 var _this=this;
    	 this.init();
     },
     methods: {
    	 
    	 init: function () {
    		 var _this=this;
    		 var url="/pmp/service/pub/pmpProject/loadProject";
    		 var param=zfesLayerEditDg.getLayerParam();
    		 zfesAjax.ajaxTodo(url,param, function(data){
        		 _this.$data.project.id=data.data.project.id;
        		 _this.$data.project.name=data.data.project.name;
        		 _this.$data.project.detail=data.data.project.detail;
        		 _this.$data.project.status=data.data.project.status;
        	 })
    	    },
    	    
    	    
        	 doUpdate: function () {
        		 var _this=this;
        	    	if($("#project_edit_form").valid()){
        	    		var url="/pmp/service/ma/pmpProject/updatePmpProject";
        	    		zfesAjax.ajaxTodo(url,_this.$data.project, function(data){
        	    			alertSwal.successText(data.message);
        	    			layer.close(layer.index);
        	    		})
        	    	}
        	    },
        
        	    cancel: function(){
        	    	 layer.close(layer.index);
        	    	 
        	    }
    }
})

 </script>
